//
//  MMGJoyStickView.h
//  MyApp
//
//  Created by Don on 2017/8/19.
//
//

#import <UIKit/UIKit.h>

@protocol MMGJoyStickViewDelegate;
@interface MMGJoyStickView : UIView
@property (nonatomic, weak) id<MMGJoyStickViewDelegate> delegate;


//+ (instancetype)createJoyStick:int ballRadius , int _moveAreaRadius , bool _isFollowTouch , bool _isCanVisible , bool _isAutoHide , bool _hasAnimation
- (instancetype)initJoyStickWithFrame:(CGRect)frame moveAreaRadius:(float)moveAreaRadius followTouch:(BOOL)isFollowTouch canVisible:(BOOL)isCanVisible autoHide:(BOOL)isAutoHide animation:(BOOL)animation;
- (void)setHitAreaWithRadius:(double)radius;
- (void)setHitAreaWithRange:(CGRect)rane;


- (void)setJSBallWithImageName:(NSString *)ballName;
//- (void)setJSStickWithImageName:(NSString *)stickName;
- (void)setJSDockWithImageName:(NSString *)dockName;

@end

@protocol MMGJoyStickViewDelegate  <NSObject>
@required
- (void)onMMGJoyStickUpdate:(MMGJoyStickView *)joyStick radian:(float)radian directionPoint:(CGPoint)point power:(float)power;
- (void)onMMGJoyStickActivated:(MMGJoyStickView *)joyStick;
- (void)onMMGJoyStickDeactivated:(MMGJoyStickView *)joyStick;

@end
